home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Resources / Online / Miami / MiamiSDK / netinclude / netinet / ip6_icmp.h < prev    next >
C/C++ Source or Header  |  1997-12-06  |  5KB  |  131 lines

  1. #ifndef _NETINET_IP6_ICMP_H_
  2. #define _NETINET_IP6_ICMP_H_
  3.  
  4. #ifndef _SYS_TYPES_H_
  5. #include <sys/types.h>
  6. #endif
  7.  
  8. #ifndef _NETINET_IN_SYSTM_H_
  9. #include <netinet/in_systm.h>
  10. #endif
  11.  
  12. #ifndef _NETINET_IN_H_
  13. #include <netinet/in.h>
  14. #endif
  15.  
  16. #ifndef _NETINET_IP6_H_
  17. #include <netinet/ip6.h>
  18. #endif
  19.  
  20. /*
  21.  * Interface Control Message Protocol Definitions.
  22.  * Per not yet RFC xxxx
  23.  */
  24.  
  25. /*
  26.  * Structure of an ICMPv6 header.
  27.  */
  28. struct icmpv6 {
  29.     u_int8_t    icmp6_type;    /* type of message, see below */
  30.     u_int8_t    icmp6_code;    /* type sub code */
  31.     u_int16_t    icmp6_cksum;    /* checksum */
  32.     union {
  33.         n_long     ih6_pmtu;        /* next MTU (for discovery) */
  34.         n_long     ih6_pptr;        /* bad parameter pointer */
  35.         n_long     ih6_flags;        /* reserved/flags field */
  36.         struct ih6_idseq {            /* echo */
  37.         n_short      icd6_id;
  38.         n_short      icd6_seq;
  39.         } ih6_idseq;
  40.         struct ih6_gmm {
  41.         n_short      igm6_mrd;        /* maximum response delay */
  42.         n_short      igm6_spare;
  43.         } ih6_gmm;
  44.         struct ih6_rtad {
  45.             u_int8_t  irta_mhlim;
  46.         u_int8_t  irta_aflg;
  47.         u_int16_t irta_life;
  48.         } ih6_rtad;
  49.     } icmp6_hun;
  50. #define icmp6_pmtu    icmp6_hun.ih6_pmtu
  51. #define icmp6_pptr    icmp6_hun.ih6_pptr
  52. #define icmp6_flags    icmp6_hun.ih6_flags
  53. #define icmp6_id    icmp6_hun.ih6_idseq.icd6_id
  54. #define icmp6_seq    icmp6_hun.ih6_idseq.icd6_seq
  55. #define icmp6_mrd    icmp6_hun.ih6_gmm.igm6_mrd
  56. #define icmp6_mhlim    icmp6_hun.ih6_rtad.irta_mhlim
  57. #define icmp6_aflg    icmp6_hun.ih6_rtad.irta_aflg
  58. #define icmp6_life    icmp6_hun.ih6_rtad.irta_life
  59.     union {
  60.         struct in6_addr id6_grp;        /* group address */
  61.         struct id6_addr {
  62.             struct in6_addr  id6_tgt;     /* target address */
  63.             struct in6_addr  id6_rdst;    /* (redirect) destination */
  64.         } id6_addr;
  65.         struct id6_nud {
  66.             u_int32_t     id6_reach;   /* reachable time */
  67.             u_int32_t     id6_retrans; /* retrans timer */
  68.         } id6_nud;
  69.         struct ipv6        id6_ip;        /* header of packet in error */
  70.         int8_t        id6_data[1];    /* echo packet data */
  71.     } icmp6_dun;
  72. #define icmp6_grp    icmp6_dun.id6_grp
  73. #define icmp6_tgt    icmp6_dun.id6_addr.id6_tgt
  74. #define icmp6_rdst    icmp6_dun.id6_addr.id6_rdst
  75. #define icmp6_reach    icmp6_dun.id6_nud.id6_reach
  76. #define icmp6_retrans    icmp6_dun.id6_nud.id6_retrans
  77. #define icmp6_ip    icmp6_dun.id6_ip
  78. #define icmp6_data    icmp6_dun.id6_data
  79. };
  80.  
  81. #define    ICMP6_MINLEN    8        /* abs minimum */
  82. #define ICMP6_GRPLEN    24        /* group stuff */
  83. #define ICMP6_RSLEN    8        /* router solicitation */
  84. #define ICMP6_RALEN    16        /* router advertisement */
  85. #define ICMP6_NSLEN    24        /* neighbor solicitation */
  86. #define ICMP6_NALEN    24        /* neighbor advertisement */
  87. #define ICMP6_RDLEN    40        /* redirect */
  88.  
  89. /*
  90.  * Definition of type and code field values.
  91.  */
  92. #define ICMP6_UNREACH        1    /* dest unreachable, codes: */
  93. #define  ICMP6_UNREACH_NOROUTE      0     /* no route to destination */
  94. #define  ICMP6_UNREACH_ADMIN      1     /* administratively prohibited */
  95. #define  ICMP6_UNREACH_RTFAIL      2     /* not a neighbor */
  96. #define  ICMP6_UNREACH_ADDRESS      3     /* address unreachable */
  97. #define  ICMP6_UNREACH_PORT      4     /* port unreachable */
  98. #define ICMP6_PKTTOOBIG        2    /* packet too big */
  99. #define ICMP6_TIMXCEED        3    /* time exceeded, code: */
  100. #define  ICMP6_TIMXCEED_INTRANS      0     /* ttl==0 in transit */
  101. #define  ICMP6_TIMXCEED_REASS      1     /* ttl==0 in reass */
  102. #define ICMP6_PARAMPROB        4    /* ip header bad */
  103. #define  ICMP6_PARAMPROB_HDR      0      /* erroneous header field */
  104. #define  ICMP6_PARAMPROB_NH      1      /* unrecognized next header */
  105. #define  ICMP6_PARAMPROB_OPT      2      /* unrecognized option */
  106. #define ICMP6_OLDREDIRECT    5    /* old redirect */
  107. #define ICMP6_ECHO        128    /* echo service */
  108. #define ICMP6_ECHOREPLY        129    /* echo reply */
  109. #define ICMP6_GROUPMEM_QUERY    130    /* group membership query */
  110. #define ICMP6_GROUPMEM_REPORT    131    /* group membership report */
  111. #define ICMP6_GROUPMEM_TERM    132    /* group membership termination */
  112. #define ICMP6_SOLICITATION_RT    133    /* router solicitation */
  113. #define ICMP6_ADVERTISEMENT_RT    134    /* router advertisment */
  114. #define ICMP6_SOLICITATION_ND    135    /* neighbor solicitation */
  115. #define ICMP6_ADVERTISEMENT_ND    136    /* neighbor advertisment */
  116. #define ICMP6_REDIRECT        137    /* redirect */
  117.  
  118. #define    ICMP6_INFOTYPE(type)    ((type) >= ICMP6_ECHO)
  119.  
  120. #define ICMP6_ND_HOPS        255    /* hop count for ND */
  121. #define ICMP6_ND_PRIORITY    IPV6_PRIORITY_15
  122.  
  123. /* IPSec flags */
  124.  
  125. #define    ICMP6SEC_ERRORS        1    /* auth error types */
  126. #define ICMP6SEC_REQUESTS    2    /* auth echo requests */
  127. #define ICMP6SEC_GROUPS        4    /* auth group management */
  128. #define ICMP6SEC_NEIGHBORS    8    /* auth neighbor management */
  129.  
  130. #endif
  131.